import type { PageParams } from '@/api/model/pageParams';
import { request } from '@/utils/request';

/**
 *  用户的分页查询
 * @param params
 */
const page = async (params: PageParams) => {
    return request.post({
        url: `/sysUser/page`,
        data: params,
    });
};

const insertApi = async (data: any) => {
    return request.post({
        url: `/sysUser/add`,
        data,
    });
};

const updateApi = async (data: any) => {
    return request.post({
        url: `/sysUser/update`,
        data,
    });
};

const deleteById = async (id: string) => {
    return request.get({
        url: `/sysUser/delete/${id}`,
    });
};

const list = async (params: PageParams) => {
    return request.post({
        url: `/sysUser/list`,
        data: params,
    });
};

export { deleteById, insertApi, list, page, updateApi };
